package at.ac.univie.zsu.aguataplan.domain;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;

/**
 * @author gerry
 * 
 */
@Entity
public class Trains extends Working {

	@ManyToOne
	private Training refTraining;

	// ----------------------------------------------------
	// CONSTRUCTOR
	// ----------------------------------------------------

	public Trains() {

	}

	// ----------------------------------------------------
	// METHODS
	// ----------------------------------------------------

	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("Id: ").append(getId()).append(", ");
		sb.append("RefPlayer: ").append(getRefPlayer()).append(", ");
		sb.append("RefTraining: ").append(getRefTraining()).append(", ");
		sb.append("RefWorkingDescription: ")
				.append(getRefWorkingDescription() == null ? "null"
						: getRefWorkingDescription().size()).append(", ");
		sb.append("Version: ").append(getVersion());
		return sb.toString();
	}

	// ----------------------------------------------------
	// GETTER & SETTER
	// ----------------------------------------------------

	public Training getRefTraining() {
		return refTraining;
	}

	public void setRefTraining(Training refTraining) {
		this.refTraining = refTraining;
	}

}
